load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "pachd",
    srcs = [
        "base.go",
        "builder.go",
        "daemon.go",
        "enterprise.go",
        "env.go",
        "full.go",
        "pachw.go",
        "paused.go",
        "preflight.go",
        "prometheus.go",
        "restore.go",
        "s3.go",
        "setup.go",
        "sidecar.go",
        "testpachd.go",
    ],
    importpath = "github.com/pachyderm/pachyderm/v2/src/internal/pachd",
    visibility = ["//src:__subpackages__"],
    deps = [
        "//src/admin",
        "//src/auth",
        "//src/debug",
        "//src/enterprise",
        "//src/identity",
        "//src/internal/admindb",
        "//src/internal/authdb",
        "//src/internal/cleanup",
        "//src/internal/client",
        "//src/internal/clusterstate",
        "//src/internal/collection",
        "//src/internal/dbutil",
        "//src/internal/dockertestenv",
        "//src/internal/errors",
        "//src/internal/grpcutil",
        "//src/internal/log",
        "//src/internal/lokiutil/client",
        "//src/internal/metrics",
        "//src/internal/middleware/auth",
        "//src/internal/middleware/errors",
        "//src/internal/middleware/logging",
        "//src/internal/middleware/logging/client",
        "//src/internal/middleware/recovery",
        "//src/internal/middleware/validation",
        "//src/internal/middleware/version",
        "//src/internal/migrations",
        "//src/internal/obj",
        "//src/internal/pachconfig",
        "//src/internal/pachsql",
        "//src/internal/pctx",
        "//src/internal/pjs",
        "//src/internal/preflight",
        "//src/internal/profileutil",
        "//src/internal/require",
        "//src/internal/restart",
        "//src/internal/serviceenv",
        "//src/internal/snapshot",
        "//src/internal/storage",
        "//src/internal/storage/fileset",
        "//src/internal/task",
        "//src/internal/testetcd",
        "//src/internal/testutil",
        "//src/internal/tls",
        "//src/internal/tracing",
        "//src/internal/transactionenv",
        "//src/license",
        "//src/logs",
        "//src/metadata",
        "//src/pfs",
        "//src/pjs",
        "//src/pps",
        "//src/proxy",
        "//src/server/admin/server",
        "//src/server/auth",
        "//src/server/auth/server",
        "//src/server/debug/server",
        "//src/server/enterprise",
        "//src/server/http",
        "//src/server/identity/server",
        "//src/server/logs/server",
        "//src/server/metadata/server",
        "//src/server/pachw/server",
        "//src/server/pfs",
        "//src/server/pfs/s3",
        "//src/server/pfs/server",
        "//src/server/pps",
        "//src/server/pps/server",
        "//src/server/proxy/server",
        "//src/server/transaction/server",
        "//src/snapshot",
        "//src/storage",
        "//src/transaction",
        "//src/version",
        "//src/version/versionpb",
        "@com_github_docker_go_units//:go-units",
        "@com_github_dustin_go_humanize//:go-humanize",
        "@com_github_jmoiron_sqlx//:sqlx",
        "@com_github_prometheus_client_golang//prometheus/promhttp",
        "@io_etcd_go_etcd_client_v3//:client",
        "@io_etcd_go_etcd_server_v3//embed",
        "@io_etcd_go_etcd_server_v3//wal",
        "@io_k8s_api//core/v1:core",
        "@io_k8s_apimachinery//pkg/api/errors",
        "@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
        "@io_k8s_apimachinery//pkg/runtime",
        "@io_k8s_client_go//dynamic",
        "@io_k8s_client_go//dynamic/fake",
        "@io_k8s_client_go//kubernetes",
        "@io_k8s_client_go//kubernetes/fake",
        "@org_golang_google_grpc//:grpc",
        "@org_golang_google_grpc//credentials/insecure",
        "@org_golang_google_grpc//health",
        "@org_golang_google_grpc//health/grpc_health_v1",
        "@org_golang_x_sync//errgroup",
        "@org_uber_go_automaxprocs//maxprocs",
        "@org_uber_go_zap//:zap",
        "@org_uber_go_zap//zapcore",
    ],
)

go_test(
    name = "pachd_test",
    size = "small",
    srcs = [
        "pachd_test.go",
        "testpachd_test.go",
    ],
    embed = [":pachd"],
    deps = [
        "//src/auth",
        "//src/internal/pctx",
        "//src/internal/require",
        "//src/pfs",
        "//src/pjs",
        "@org_golang_google_protobuf//types/known/emptypb",
    ],
)
